import React, {Component} from 'react';
import './index.css'
import MyNavLink from "../../components/MyNavLink";
import {Redirect, Route, Switch} from "react-router-dom";
import News from "./News";
import Message from "./Message";

class Home extends Component {
  render() {
    return (
      <>
        <h2>Home组件内容</h2>
        <div>
          <ul className="nav nav-tabs">
            <li>
              <MyNavLink to="/home/news">News</MyNavLink>
            </li>
            <li>
              <MyNavLink to="/home/message">Message</MyNavLink>
            </li>
          </ul>

          <Switch>
            <Route path="/home/news" component={News}/>
            <Route path="/home/message" component={Message}/>
            <Redirect to="/home/message"/>
          </Switch>
        </div>
      </>
    );
  }
}

export default Home;